import React, { memo } from 'react';
import { useDispatch, useSelector } from 'react-redux'
import { Radio, Card } from '@arco-design/web-react';
import {
  IconWeibo,
  IconMessage,
  IconTiktokColor,
} from '@arco-design/web-react/icon';
const RadioGroup = Radio.Group;
export default memo(function HotResource() {
  const dispatch = useDispatch()
  const hotresource = useSelector(state => state.hotresource)
  const onChange = e => {
    dispatch({
      type:'hotresource',
      data:e
    })
  };
  return (
    <Card title='热点源'>
      <RadioGroup
        defaultValue={ hotresource|| '/resou'}
        onChange={e => {
          onChange(e);
        }}
      >
        <Radio value='/resou'>
          <IconWeibo />
          微博
        </Radio>
        <Radio value='/douyinresou'>
          <IconTiktokColor />
          抖音
        </Radio>
        <Radio value='/zhihuresou'>
          <IconMessage />
          知乎o
        </Radio>
      </RadioGroup>
    </Card>
  );
});
